package com.homework.service.impl;

import com.homework.mapper.EmployeeMapper;
import com.homework.pojo.Employee;
import com.homework.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public List<Employee> findAll() {
        return employeeMapper.findAll();
    }

    @Transactional
    @Override
    public void save(Employee employee) {
        employeeMapper.save(employee);
    }
}
